<?php
/**
 * 公共继承类
 *
 * PHP Version 5.6
 *
 * @author    guanxu <510104561@qq.com>
 * @time      2017/08/11
 */
namespace Admin\Controller;
use Common\Common\ConstantUtil;
use Think\Controller;
class CommonController extends Controller {


    public function _initialize() {

        $user = session("admin_user");
        if(empty($user)) $this->error("请登录!","/Admin/index/login");
        if($user["rank"] == ConstantUtil::POWER_SUPER_MANAGE) return true;
        $function = session('admin_modules')["function"];
        $url = U(CONTROLLER_NAME."/".ACTION_NAME);
        if($url == '/Admin/Modules/select.html') return true;
        if($url == '/Admin/Modules/columnSelect.html') return true;
        if(!in_array($url,$function))  $this->error("无权限!");
    }




}